package mianxiangduixianganlie;

import java.util.Scanner;

public class Car_rental_management {
    public static void main(String[] args) {
        System.out.println("金路至尊租赁有限公司欢迎您：请致电999999999洽谈相关租赁业务");
        System.out.print("本公司现有车可租");
        Scanner in = new Scanner(System.in);
        int choice = 0;
        Cars cars = new Cars();
        Limousine limousine = new Limousine();
        Passengercar passengercar = new Passengercar();
        while (true) {
            System.out.println("1:查看车辆情况,2:租赁,3:还车,4:报废,5:采购新车,6.查看租赁记录,9:退出");
            choice = in.nextInt();
            switch (choice) {
                case 1: {
                    cars.show();
                }
                break;
            //租赁车辆
                case 2: {
                    System.out.println("请输入要租赁的类型（轿车/客车）：");
                    choice = in.nextInt();
                    switch (choice){
                        case 1:{
                            cars.zulin(limousine);
                        }break;
                        case 2:{
                            cars.zulin1(passengercar);
                        }break;
                    }
                }
                break;
                //还车
                case 3: {
                    cars.huanche();
                }
                break;
                //报废车辆
                case 4: {
                       cars.baofei();
                       cars.baofei1();
                }
                break;


                //采购新车
                case 5: {
                    int choicelx = 0;
                    System.out.print("新车类型（1：轿车,2：客车）");
                    choicelx = in.nextInt();
                    switch (choicelx) {
                        //采购轿车
                        case 1: {
                            System.out.print("新车品牌：");
                            String brand = in.next();
                            limousine.setBrand(brand);
                            System.out.print("车牌号：");
                            limousine.setLpnumber(in.next());
                            System.out.print("日租金：");
                            limousine.setDailyrent(in.nextInt());
                            System.out.print("座位数：");
                            limousine.setSeating(in.nextInt());
                        } cars.add(limousine);
                        break;
                        //采购客车
                        case 2: {
                            System.out.print("新车品牌：");
                            String brand = in.next();
                            passengercar.setBrand(brand);
                            System.out.print("车牌号：");
                            passengercar.setLpnumber(in.next());
                            System.out.print("日租金：");
                            passengercar.setDailyrent(in.nextInt());
                            System.out.print("座位数：");
                            passengercar.setSeating(in.nextInt());
                        }cars.add1(passengercar);
                    }
                }break;
                case 6: {
                }
                break;
                case 9: {
                    return;
                }
            }
        }
    }
}

